package com.wkbb.sports.model;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.wkbb.common.handler.JsonUtil;
import com.wkbb.sports.dto.TrainStudentDetailDto;
import com.wkbb.sports.utils.DateJacksonConverter;
import com.wkbb.sports.utils.DateJacksonSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * hlife_train_student
 * @author 惠普
 * @date 2021-03-22 18:05:14
 */
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
public class HlifeTrainStudent implements Serializable {
    //标准成绩2
    private String achievement2;

    /**
     * 编号
     */
    private Long id;

    /**
     * 训练ID
     */
    private Long trainId;

    /**
     * 项目ID
     */
    private Long projectId;

    /**
     * 学校ID
     */
    private Long orgId;

    /**
     * 年级ID
     */
    private Long gradeId;

    /**
     * 年级名称
     */
    private String gradeName;

    /**
     * 班级ID
     */
    private Long classId;

    /**
     * 班级名称
     */
    private String className;

    /**
     * 组别
     */
    private String groupId;

    /**
     * 老师ID
     */
    private Long teacherId;

    /**
     * 设备ID
     */
    private String deviceId;

    /**
     * 学生ID
     */
    private Long studentId;

    /**
     * 学生名称
     */
    private String studentName;

    /**
     * 性别(1男2女)
     */
    private Byte sex;

    /**
     * 学号
     */
    private String studentNo;

    @ApiModelProperty(value = "训练日期")
    private Date trainDate;

    /**
     * 标准成绩
     */
    private String achievement;

    /**
     * 得分
     */
    private Double score;

    /**
     * 成绩等级：1优秀 2良好 3及格 4不及格
     */
    private int scoreLevel;

    /**
     * 加分项得分
     */
    private Double plusScore;
    
    public Double getTotalScore() {
    	double totalScore = 0;
		if(score != null) {
			totalScore += score;
		}
		if(plusScore != null) {
			totalScore += plusScore;
		}
		return totalScore;
    }
    
    /*
     * 失误总次数
     */
	private Integer errorCount = 0;
	
    /*
     * 失误总耗时
     */
    private Integer errorTime = 0;
    
    /*
     * 平均耗时
     */
    private Integer avgTime = 0;
    
    /*
     * 有效平均值(中位数)
     */
    private Integer medianTime = 0;
    
    /*
     * 失误 损失次数
     */
    private Integer lossesCount1 = 0;
    
    /*
     * 甩绳速度偏慢 损失次数
     */
    private Integer lossesCount2 = 0;
    
    /*
     * 进入状态过慢 损失次数
     */
    private Integer lossesCount3 = 0;
    
    /*
     * 高一档分数段
     */
    private Integer HigherScore = 0;
    
    /*
     * 高一档分数段 要求次数
     */
    private Integer HigherScoreCount = 0;
    
    /*
     * 进入状态耗时
     */
    private Integer intoStateTime = 0;
    
    /*
     * 次数提升空间
     */
    private Integer improveCount = 0;
    
    /*
     * 分数提升空间
     */
    private Double improveScore = 0.0;

    /*
     * 家长消息发送标识
     */
    private Byte familySendFlag;
    
    
  //敏捷最快反应时间
    private Integer fastReaction;
    
    //敏捷最慢反应时间
    private Integer slowReaction;
    
    //敏捷平均反应时间
    private Integer avgReaction;
    
    //敏捷正确次数
    private Integer  rightCount;
    
    //敏捷错误次数
    private Integer wrongCount;
    
    //敏捷完成总数
    private Integer  totalCount;
    
    //敏捷平均准确率
    private Double avgRightRate;
    
    private List<TrainStudentDetailDto> details;

    public void setDetails(List<TrainStudentDetailDto> details) {
        this.details = details;
    }

    public void setDetails(String details) {
        this.details = JsonUtil.jsonToList(details,TrainStudentDetailDto.class);
    }
}